package kayao.client.scene;

public class Region {
	private float mX1;
	private float mY1;
	private float mX2;
	private float mY2;
	private boolean mSubscribed = false;

	public Region(float x1, float y1, float x2, float y2){
		this.mX1 = x1;
		this.mY1 = y1;
		this.mX2 = x2;
		this.mY2 = y2;
	}

	public String toString(){
		return "("+mX1+", "+mY1+")  ("+mX2+", "+mY2+")";
	}
	public boolean isIntersecting(float x, float y){
		if (x >= mX1 && x <= mX2){			
			if (y >= mY1 && y <= mY2){
				return true;
			}
		}
		return false;
	}
	public boolean isSubscribed(){
		return mSubscribed;
	}
	public void subscribe(){
			mSubscribed = true;
	}
	public void unSubscribe(){
		this.mSubscribed = false;
	}
}